﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HotelBooking
{
    
    public class TravelAgency
    {


        //delegate 
        public delegate void TravelHandler(string order);
        public event TravelHandler TravelSentOrder;

        public OrderObject Order { get; set; }
        private int cardNumber;

     
        private int id;

        public TravelAgency(int id, int cardNumber)
        {
            this.id = id;
            this.cardNumber = cardNumber;
        }
        public OrderObject order
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
            }
        }

    
        public void EvaluatePrice(float newPrice, int Sender, int roomsAvailable)
        {
            Order = new OrderObject();
            Order.ReceiverID = this.id;
            Order.SenderId = Sender;
            Order.CardNo = this.cardNumber;
            Order.Amount = roomsAvailable;
            String encodedOrder = Encoder.Converter(Order);
            SendString(encodedOrder);
         
        }


        protected void SendString(String order)
        {
            TravelSentOrder(order);            
        }

    }
}
